hysop.operator.directional.symbolic_dir module¶
@file symbolic_dir.py Directional symbolic frontends (operator generator).
- class hysop.operator.directional.symbolic_dir.DirectionalSymbolic(name, exprs, variables, no_split=False, fixed_residue=0, force_residue=None, implementation=None, base_kwds=None, candidate_input_tensors=None, candidate_output_tensors=None, **kwds)[source]¶
Bases:
DirectionalOperatorFrontend
Custom symbolic expression directional splitting. Available implementations are:
*OpenCL
Initialize a DirectionalSymbolic operator frontend.
Expressions are first splitted using contiguous memory accesses imposed by the discretization of field derivatives with finite differences.
If the splitting is not possible (ie. an expression contains multiple derivatives in different directions that cannot be splitted), a ValueError is raised.
See hysop.operator.base.custom_symbolic.CustomSymbolicOperatorBase to see how expressions are parsed.
- Parameters:
name (str) – Name of this custom operator.
exprs (hysop.symbolic.exprs or array like of valid expresions) – Expressions that will generate code. Valid expressions are defined in SymbolicExpressionParser.
variables (dict) – dictionary of fields as keys and topology descriptors as values.
fixed_residue (sm.Expr or array like sm.Expr) – Add a direction agnostic (unsplittable) extra residue to each right hand sides Defaults to 0.
force_residue (Expr, defaults to None) – Disable residue computation and use this value instead. fixed_residue is added to this force_residue.
no_split (bool, optional, defaults to False) – Skip the directional expression splitting step and broadcast expressions to each axes.
implementation (Implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().
base_kwds (dict, optional, defaults to None) – Base class keywords arguments. If None, an empty dict will be passed.
kwds – Keywords arguments that will be passed towards implementation operator __init__.
Notes
A valid implementation should at least support the hysop.base.custom_symbolic.CustomSymbolicOperatorBase interface.
- custom_directional_kwds(i)[source]¶
Specify custom keyword arguments that will be passed only for direction i.